<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Term vectors API | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'docs-termvectors.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/docs-termvectors.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/docs-termvectors.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/docs-termvectors.html" rel="nofollow" target="_blank">../en/docs-termvectors.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="rest-apis.html">REST APIs</a></span>
»
<span class="breadcrumb-link"><a href="docs.html">Document APIs</a></span>
»
<span class="breadcrumb-node">Term vectors API</span>
</div>
<div class="navheader">
<span class="prev">
<a href="docs-reindex.html">« Reindex API</a>
</span>
<span class="next">
<a href="docs-multi-termvectors.html">Multi term vectors API »</a>
</span>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="docs-termvectors"></a>Term vectors API<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h2>
</div></div></div>

<p>Retrieves information and statistics for terms in the fields of a particular document.</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /twitter/_termvectors/1</pre>
</div>
<div class="console_widget" data-snippet="snippets/1559.console"></div>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="docs-termvectors-api-request"></a>Request<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h3>
</div></div></div>
<p><code class="literal">GET /&lt;index&gt;/_termvectors/&lt;_id&gt;</code></p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="docs-termvectors-api-desc"></a>Description<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h3>
</div></div></div>
<p>You can retrieve term vectors for documents stored in the index or
for <em>artificial</em> documents passed in the body of the request.</p>
<p>You can specify the fields you are interested in through the <code class="literal">fields</code> parameter,
or by adding the fields to the request body.</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /twitter/_termvectors/1?fields=message</pre>
</div>
<div class="console_widget" data-snippet="snippets/1560.console"></div>
<p>Fields can be specified using wildcards, similar to the <a class="xref" href="query-dsl-multi-match-query.html" title="Multi-match query">multi match query</a>.</p>
<p>Term vectors are <a class="xref" href="docs-get.html#realtime" title="Realtime">real-time</a> by default, not near real-time.
This can be changed by setting <code class="literal">realtime</code> parameter to <code class="literal">false</code>.</p>
<p>You can request three types of values: <em>term information</em>, <em>term statistics</em>
and <em>field statistics</em>. By default, all term information and field
statistics are returned for all fields but term statistics are excluded.</p>
<div class="section">
<div class="titlepage"><div><div>
<h4 class="title">
<a id="docs-termvectors-api-term-info"></a>Term information<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h4>
</div></div></div>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
term frequency in the field (always returned)
</li>
<li class="listitem">
term positions (<code class="literal">positions</code> : true)
</li>
<li class="listitem">
start and end offsets (<code class="literal">offsets</code> : true)
</li>
<li class="listitem">
term payloads (<code class="literal">payloads</code> : true), as base64 encoded bytes
</li>
</ul>
</div>
<p>If the requested information wasn’t stored in the index, it will be
computed on the fly if possible. Additionally, term vectors could be computed
for documents not even existing in the index, but instead provided by the user.</p>
<div class="warning admon">
<div class="icon"></div>
<div class="admon_content">
<p>Start and end offsets assume UTF-16 encoding is being used. If you want to use
these offsets in order to get the original text that produced this token, you
should make sure that the string you are taking a sub-string of is also encoded
using UTF-16.</p>
</div>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h4 class="title">
<a id="docs-termvectors-api-term-stats"></a>Term statistics<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h4>
</div></div></div>
<p>Setting <code class="literal">term_statistics</code> to <code class="literal">true</code> (default is <code class="literal">false</code>) will
return</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
total term frequency (how often a term occurs in all documents)<br>
</li>
<li class="listitem">
document frequency (the number of documents containing the current
term)
</li>
</ul>
</div>
<p>By default these values are not returned since term statistics can
have a serious performance impact.</p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h4 class="title">
<a id="docs-termvectors-api-field-stats"></a>Field statistics<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h4>
</div></div></div>
<p>Setting <code class="literal">field_statistics</code> to <code class="literal">false</code> (default is <code class="literal">true</code>) will
omit :</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
document count (how many documents contain this field)
</li>
<li class="listitem">
sum of document frequencies (the sum of document frequencies for all
terms in this field)
</li>
<li class="listitem">
sum of total term frequencies (the sum of total term frequencies of
each term in this field)
</li>
</ul>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h4 class="title">
<a id="docs-termvectors-api-terms-filtering"></a>Terms filtering<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h4>
</div></div></div>
<p>With the parameter <code class="literal">filter</code>, the terms returned could also be filtered based
on their tf-idf scores. This could be useful in order find out a good
characteristic vector of a document. This feature works in a similar manner to
the <a class="xref" href="query-dsl-mlt-query.html#mlt-query-term-selection" title="Term Selection Parameters">second phase</a> of the
<a class="xref" href="query-dsl-mlt-query.html" title="More like this query">More Like This Query</a>. See <a class="xref" href="docs-termvectors.html#docs-termvectors-terms-filtering" title="Terms filtering">example 5</a>
for usage.</p>
<p>The following sub-parameters are supported:</p>
<div class="informaltable">
<table border="0" cellpadding="4px">
<colgroup>
<col>
<col>
</colgroup>
<tbody valign="top">
<tr>
<td valign="top">
<p>
<code class="literal">max_num_terms</code>
</p>
</td>
<td valign="top">
<p>
Maximum number of terms that must be returned per field. Defaults to <code class="literal">25</code>.
</p>
</td>
</tr>
<tr>
<td valign="top">
<p>
<code class="literal">min_term_freq</code>
</p>
</td>
<td valign="top">
<p>
Ignore words with less than this frequency in the source doc. Defaults to <code class="literal">1</code>.
</p>
</td>
</tr>
<tr>
<td valign="top">
<p>
<code class="literal">max_term_freq</code>
</p>
</td>
<td valign="top">
<p>
Ignore words with more than this frequency in the source doc. Defaults to unbounded.
</p>
</td>
</tr>
<tr>
<td valign="top">
<p>
<code class="literal">min_doc_freq</code>
</p>
</td>
<td valign="top">
<p>
Ignore terms which do not occur in at least this many docs. Defaults to <code class="literal">1</code>.
</p>
</td>
</tr>
<tr>
<td valign="top">
<p>
<code class="literal">max_doc_freq</code>
</p>
</td>
<td valign="top">
<p>
Ignore words which occur in more than this many docs. Defaults to unbounded.
</p>
</td>
</tr>
<tr>
<td valign="top">
<p>
<code class="literal">min_word_length</code>
</p>
</td>
<td valign="top">
<p>
The minimum word length below which words will be ignored. Defaults to <code class="literal">0</code>.
</p>
</td>
</tr>
<tr>
<td valign="top">
<p>
<code class="literal">max_word_length</code>
</p>
</td>
<td valign="top">
<p>
The maximum word length above which words will be ignored. Defaults to unbounded (<code class="literal">0</code>).
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>

</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="docs-termvectors-api-behavior"></a>Behaviour<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h3>
</div></div></div>
<p>The term and field statistics are not accurate. Deleted documents
are not taken into account. The information is only retrieved for the
shard the requested document resides in.
The term and field statistics are therefore only useful as relative measures
whereas the absolute numbers have no meaning in this context. By default,
when requesting term vectors of artificial documents, a shard to get the statistics
from is randomly selected. Use <code class="literal">routing</code> only to hit a particular shard.</p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="docs-termvectors-api-path-params"></a>Path parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">&lt;index&gt;</code>
</span>
</dt>
<dd>
(Required, string) Name of the index that contains the document.
</dd>
<dt>
<span class="term">
<code class="literal">&lt;_id&gt;</code>
</span>
</dt>
<dd>
(Optional, string) Unique identifier of the document.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="docs-termvectors-api-query-params"></a>Query parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">fields</code>
</span>
</dt>
<dd>
<p>(Optional, string)
Comma-separated list or wildcard expressions of fields
to include in the statistics.</p>
<p>Used as the default list
unless a specific field list is provided
in the <code class="literal">completion_fields</code> or <code class="literal">fielddata_fields</code> parameters.</p>
</dd>
<dt>
<span class="term">
<code class="literal">field_statistics</code>
</span>
</dt>
<dd>
(Optional, boolean) If <code class="literal">true</code>, the response includes the document count, sum of document frequencies,
and sum of total term frequencies.
Defaults to <code class="literal">true</code>.
</dd>
<dt>
<span class="term">
<code class="literal">&lt;offsets&gt;</code>
</span>
</dt>
<dd>
(Optional, boolean) If <code class="literal">true</code>, the response includes term offsets.
Defaults to <code class="literal">true</code>.
</dd>
<dt>
<span class="term">
<code class="literal">payloads</code>
</span>
</dt>
<dd>
(Optional, boolean) If <code class="literal">true</code>, the response includes term payloads.
Defaults to <code class="literal">true</code>.
</dd>
<dt>
<span class="term">
<code class="literal">positions</code>
</span>
</dt>
<dd>
(Optional, boolean) If <code class="literal">true</code>, the response includes term positions.
Defaults to <code class="literal">true</code>.
</dd>
<dt>
<span class="term">
<code class="literal">preference</code>
</span>
</dt>
<dd>
(Optional, string) Specifies the node or shard the operation should be
performed on. Random by default.
</dd>
<dt>
<span class="term">
<code class="literal">routing</code>
</span>
</dt>
<dd>
(Optional, string) Target the specified primary shard.
</dd>
<dt>
<span class="term">
<code class="literal">realtime</code>
</span>
</dt>
<dd>
(Optional, boolean) If <code class="literal">true</code>, the request is real-time as opposed to near-real-time.
Defaults to <code class="literal">true</code>. See <a class="xref" href="docs-get.html#realtime" title="Realtime">Realtime</a>.
</dd>
<dt>
<span class="term">
<code class="literal">term_statistics</code>
</span>
</dt>
<dd>
(Optional, boolean) If <code class="literal">true</code>, the response includes term frequency and document frequency.
Defaults to <code class="literal">false</code>.
</dd>
<dt>
<span class="term">
<code class="literal">version</code>
</span>
</dt>
<dd>
(Optional, boolean) If <code class="literal">true</code>, returns the document version as part of a hit.
</dd>
<dt>
<span class="term">
<code class="literal">version_type</code>
</span>
</dt>
<dd>
(Optional, enum) Specific version type: <code class="literal">internal</code>, <code class="literal">external</code>,
<code class="literal">external_gte</code>.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="docs-termvectors-api-example"></a>Examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="section">
<div class="titlepage"><div><div>
<h4 class="title">
<a id="docs-termvectors-api-stored-termvectors"></a>Returning stored term vectors<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h4>
</div></div></div>
<p>First, we create an index that stores term vectors, payloads etc. :</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">PUT /twitter
{ "mappings": {
    "properties": {
      "text": {
        "type": "text",
        "term_vector": "with_positions_offsets_payloads",
        "store" : true,
        "analyzer" : "fulltext_analyzer"
       },
       "fullname": {
        "type": "text",
        "term_vector": "with_positions_offsets_payloads",
        "analyzer" : "fulltext_analyzer"
      }
    }
  },
  "settings" : {
    "index" : {
      "number_of_shards" : 1,
      "number_of_replicas" : 0
    },
    "analysis": {
      "analyzer": {
        "fulltext_analyzer": {
          "type": "custom",
          "tokenizer": "whitespace",
          "filter": [
            "lowercase",
            "type_as_payload"
          ]
        }
      }
    }
  }
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1561.console"></div>
<p>Second, we add some documents:</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">PUT /twitter/_doc/1
{
  "fullname" : "John Doe",
  "text" : "twitter test test test "
}

PUT /twitter/_doc/2?refresh=wait_for
{
  "fullname" : "Jane Doe",
  "text" : "Another twitter test ..."
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1562.console"></div>
<p>The following request returns all information and statistics for field
<code class="literal">text</code> in document <code class="literal">1</code> (John Doe):</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /twitter/_termvectors/1
{
  "fields" : ["text"],
  "offsets" : true,
  "payloads" : true,
  "positions" : true,
  "term_statistics" : true,
  "field_statistics" : true
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1563.console"></div>
<p>Response:</p>
<div class="pre_wrapper lang-console-result">
<pre class="programlisting prettyprint lang-console-result">{
    "_id": "1",
    "_index": "twitter",
    "_type": "_doc",
    "_version": 1,
    "found": true,
    "took": 6,
    "term_vectors": {
        "text": {
            "field_statistics": {
                "doc_count": 2,
                "sum_doc_freq": 6,
                "sum_ttf": 8
            },
            "terms": {
                "test": {
                    "doc_freq": 2,
                    "term_freq": 3,
                    "tokens": [
                        {
                            "end_offset": 12,
                            "payload": "d29yZA==",
                            "position": 1,
                            "start_offset": 8
                        },
                        {
                            "end_offset": 17,
                            "payload": "d29yZA==",
                            "position": 2,
                            "start_offset": 13
                        },
                        {
                            "end_offset": 22,
                            "payload": "d29yZA==",
                            "position": 3,
                            "start_offset": 18
                        }
                    ],
                    "ttf": 4
                },
                "twitter": {
                    "doc_freq": 2,
                    "term_freq": 1,
                    "tokens": [
                        {
                            "end_offset": 7,
                            "payload": "d29yZA==",
                            "position": 0,
                            "start_offset": 0
                        }
                    ],
                    "ttf": 2
                }
            }
        }
    }
}</pre>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h4 class="title">
<a id="docs-termvectors-api-generate-termvectors"></a>Generating term vectors on the fly<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h4>
</div></div></div>
<p>Term vectors which are not explicitly stored in the index are automatically
computed on the fly. The following request returns all information and statistics for the
fields in document <code class="literal">1</code>, even though the terms haven’t been explicitly stored in the index.
Note that for the field <code class="literal">text</code>, the terms are not re-generated.</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /twitter/_termvectors/1
{
  "fields" : ["text", "some_field_without_term_vectors"],
  "offsets" : true,
  "positions" : true,
  "term_statistics" : true,
  "field_statistics" : true
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1564.console"></div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h4 class="title">
<a id="docs-termvectors-artificial-doc"></a>Artificial documents<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h4>
</div></div></div>
<p>Term vectors can also be generated for artificial documents,
that is for documents not present in the index.  For example, the following request would
return the same results as in example 1. The mapping used is determined by the <code class="literal">index</code>.</p>
<p><span class="strong strong"><strong>If dynamic mapping is turned on (default), the document fields not in the original
mapping will be dynamically created.</strong></span></p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /twitter/_termvectors
{
  "doc" : {
    "fullname" : "John Doe",
    "text" : "twitter test test test"
  }
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1565.console"></div>
<div class="section">
<div class="titlepage"><div><div>
<h5 class="title">
<a id="docs-termvectors-per-field-analyzer"></a>Per-field analyzer<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h5>
</div></div></div>
<p>Additionally, a different analyzer than the one at the field may be provided
by using the <code class="literal">per_field_analyzer</code> parameter. This is useful in order to
generate term vectors in any fashion, especially when using artificial
documents. When providing an analyzer for a field that already stores term
vectors, the term vectors will be re-generated.</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /twitter/_termvectors
{
  "doc" : {
    "fullname" : "John Doe",
    "text" : "twitter test test test"
  },
  "fields": ["fullname"],
  "per_field_analyzer" : {
    "fullname": "keyword"
  }
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1566.console"></div>
<p>Response:</p>
<div class="pre_wrapper lang-console-result">
<pre class="programlisting prettyprint lang-console-result">{
  "_index": "twitter",
  "_type": "_doc",
  "_version": 0,
  "found": true,
  "took": 6,
  "term_vectors": {
    "fullname": {
       "field_statistics": {
          "sum_doc_freq": 2,
          "doc_count": 4,
          "sum_ttf": 4
       },
       "terms": {
          "John Doe": {
             "term_freq": 1,
             "tokens": [
                {
                   "position": 0,
                   "start_offset": 0,
                   "end_offset": 8
                }
             ]
          }
       }
    }
  }
}</pre>
</div>
</div>

</div>

<div class="section">
<div class="titlepage"><div><div>
<h4 class="title">
<a id="docs-termvectors-terms-filtering"></a>Terms filtering<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/docs/termvectors.asciidoc">edit</a>
</h4>
</div></div></div>
<p>Finally, the terms returned could be filtered based on their tf-idf scores. In
the example below we obtain the three most "interesting" keywords from the
artificial document having the given "plot" field value. Notice
that the keyword "Tony" or any stop words are not part of the response, as
their tf-idf must be too low.</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /imdb/_termvectors
{
    "doc": {
      "plot": "When wealthy industrialist Tony Stark is forced to build an armored suit after a life-threatening incident, he ultimately decides to use its technology to fight against evil."
    },
    "term_statistics" : true,
    "field_statistics" : true,
    "positions": false,
    "offsets": false,
    "filter" : {
      "max_num_terms" : 3,
      "min_term_freq" : 1,
      "min_doc_freq" : 1
    }
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1567.console"></div>
<p>Response:</p>
<div class="pre_wrapper lang-console-result">
<pre class="programlisting prettyprint lang-console-result">{
   "_index": "imdb",
   "_type": "_doc",
   "_version": 0,
   "found": true,
   "term_vectors": {
      "plot": {
         "field_statistics": {
            "sum_doc_freq": 3384269,
            "doc_count": 176214,
            "sum_ttf": 3753460
         },
         "terms": {
            "armored": {
               "doc_freq": 27,
               "ttf": 27,
               "term_freq": 1,
               "score": 9.74725
            },
            "industrialist": {
               "doc_freq": 88,
               "ttf": 88,
               "term_freq": 1,
               "score": 8.590818
            },
            "stark": {
               "doc_freq": 44,
               "ttf": 47,
               "term_freq": 1,
               "score": 9.272792
            }
         }
      }
   }
}</pre>
</div>
</div>

</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="docs-reindex.html">« Reindex API</a>
</span>
<span class="next">
<a href="docs-multi-termvectors.html">Multi term vectors API »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>